package SpringCloudBase;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/**
 * Hello world!
 *
 */
@SpringBootApplication
@EnableEurekaClient
@EnableCircuitBreaker//启用熔断
public class ConsumerHystrixApplication
{
    public static void main( String[] args )
    {
        System.out.println( "正在加载Hyteix，稍等！" );
        SpringApplication.run(ConsumerHystrixApplication.class);
    }

    @Bean //自动加载RestTemplate
    public RestTemplate getRestTemplate(){
        return new RestTemplate();
    }

}
